#pragma once
#include "messageHandler.h"
#include "mtpMessage.h"

class MtpMessageHandler : public MessageHandler<String,IPaddress>
{
protected:
    virtual void handle(Message<String>* message, const IPaddress& attachment);
    virtual Message<String>* decode(Protocol<String>* packet, const IPaddress& attachment);

    virtual void handle(MtpMessage* message, const IPaddress& attachment) = 0;
    virtual MtpMessage* decode(MtpProtocol* packet, const IPaddress& attachment) = 0;

    virtual void handleMessageError(Message<String>* message, const IPaddress& attachment, std::exception& e);
};

